package com.itheima.tlias.controller;

import com.itheima.tlias.model.dto.EmpQueryDTO;
import com.itheima.tlias.model.entity.Emp;
import com.itheima.tlias.model.response.PageResult;
import com.itheima.tlias.model.response.Result;
import com.itheima.tlias.service.EmpService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Lee
 * @created 2024/4/8
 * @describtion
 */
@RestController
@RequestMapping(path = "/emps")
public class EmpController {
    @Autowired
    private EmpService empService;

    @GetMapping
    public Result<PageResult<Emp>> emps(EmpQueryDTO dto) {
        PageResult<Emp> data = empService.list(dto);
        return Result.success(data);

    }


}
